#ifndef TLOGIN_H
#define TLOGIN_H

#include "TContext.h"
#include <QDialog>
#include "../remote/TAuthenticator.h"

namespace Ui {
class TLogin;
}

class TLogin : public QDialog
{
    Q_OBJECT

public:
    static const int SUCCESS = 1;
    static const int FAIL = 0;
    //static const int AUTOUPDATE = 99;

private:
    bool   _pressed;
    QPoint _moveStartPosition;
    
public:
    explicit TLogin(QWidget *parent = 0);
    ~TLogin();

protected:
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);

private slots:
    void doLogin();
    void loginFinished(bool error, TSessionPointer session);
    
private:
    Ui::TLogin *ui;
    TAuthenticator* _authenticator;
};

#endif // TLOGIN_H
